﻿Module Module1
    Function Bai15(ByVal n As Integer) As Double
        Dim S As Double = 0
        Dim M As Integer = 0
        Dim i As Integer
        For i = 1 To n Step 1
            M = M + i
            S = S + (1 / M)
        Next
        Return S
    End Function
    Sub Main()
        Dim n As Integer
        Console.WriteLine("Nhap so n: ")
        n = Console.ReadLine()
        Dim kq As Double
        kq = Bai15(n)
        Console.WriteLine("S(n)= " & kq)
    End Sub
End Module
